package com.cookie.framework.event;

import org.greenrobot.eventbus.EventBus;

/**
 * 项目名:    MeetProject
 * 包名:      com.cookie.framework.event
 * 文件名:    EventManager
 * 创建者:    cookie
 * 创建时间:   2020/1/14 22:33
 * 描述:      EventBus调度类
 */

public class EventManager {

    //更新好友列表
    public static final int FLAG_UPDATE_FRIEND_LIST = 1000;

    //发送文本数据
    public static final int FLAG_SEND_TEXT = 1001;

    //发送图片数据
    public static final int FLAG_SEND_IMAGE = 1002;

    //发送位置数据
    public static final int FLAG_SEND_LOCATION = 1003;

    //相机数据
    public static final int FLAG_SEND_CAMERA_VIEW = 1004;

    //刷新个人信息
    public static final int EVENT_REFRE_ME_INFO = 1006;

    //注册
    public static void register(Object subscriber) {
        EventBus.getDefault().register(subscriber);
    }

    //反注册
    public static void unregister(Object subscriber) {
        EventBus.getDefault().unregister(subscriber);
    }

    public static void post(int type) {
        EventBus.getDefault().post(new MessageEvent(type));
    }

    public static void post(MessageEvent event) {
        EventBus.getDefault().post(event);
    }
}
